Skip to content
This repository has been archived by the owner on Apr 12, 2024. It is now read-only.

fix($compile) support templates with table content root nodes #5235

Closed
wants to merge 1 commit into from

Conversation

caitp
Copy link
Contributor

@caitp caitp commented Dec 2, 2013

Some hack-ish logic to get compile to avoid throwing up on table content as root nodes.

I'm sure this can be improved upon, and certain things (like the regexp) could be moved outside of the function. Suggestions would be good.

demo1 | demo2

Closes #2848
Closes #1459
Closes #3647
Closes #3241

@mary-poppins
Copy link

Thanks for the PR!

  • Contributor signed CLA now or in the past
    • If you just signed, leave a comment here with your real name
  • PR's commit messages follow the commit message format

If you need to make changes to your pull request, you can update the commit with git commit --amend.
Then, update the pull request with git push -f.

Thanks again for your help!

@caitp
Copy link
Contributor Author

caitp commented Dec 12, 2013

Edited to also support templateUrl templates

@michael-wirth
Copy link

Thanks for the fix. It work fine for me!! Hope it makes it into the next release

If the first element in a template is a <tr>, <th>, <td>, or <tbody> tag,
the HTML compiler will ensure that the template is wrapped in a <table>
element so that the table content is not discarded.
@caitp
Copy link
Contributor Author

caitp commented Jan 25, 2014

I think we should try to get mine, or one of the other solutions to this issue into the tree for the next release, since this would definitely be a pretty useful thing for people to have.

I'm open to any feedback on the implementation and ways to improve it.

@IgorMinar
Copy link
Contributor

lgtm

@tbosch tbosch modified the milestones: 1.2.12, 1.2.11, 1.2.13 Feb 3, 2014
@davidjnelson
Copy link
Contributor

+1

@caitp
Copy link
Contributor Author

caitp commented Feb 14, 2014

Merged in 31c450b

@caitp caitp closed this Feb 14, 2014
caitp referenced this pull request Feb 14, 2014
If the first element in a template is a <tr>, <th>, <td>, or <tbody> tag,
the HTML compiler will ensure that the template is wrapped in a <table>
element so that the table content is not discarded.

Closes #2848
Closes #1459
Closes #3647
Closes #3241
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.